package com.server.rule.factory;

import org.jeasy.rules.api.Rules;
import org.jeasy.rules.mvel.MVELRuleFactory;
import org.jeasy.rules.support.reader.YamlRuleDefinitionReader;

/**
 * Description: This is a sample class.
 * @Author Simon
 */
public class NettyMvelRuleFactory {
    private volatile static MVELRuleFactory mvelRuleFactory;
    private NettyMvelRuleFactory(){

    }
    public static MVELRuleFactory getInstance(){
        if(mvelRuleFactory==null){
            synchronized (NettyMvelRuleFactory.class){
                if (mvelRuleFactory==null){
                    mvelRuleFactory=new MVELRuleFactory(new YamlRuleDefinitionReader());
                }
            }
        }
        return mvelRuleFactory;
    }
}
